package dir;

import java.io.File;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.UUID;

/**
 * @author wzby
 * @Date: 2022/8/1 20:06
 */
public class Dir7 {
    //方法名为create命令不执行
    public static void main(String[] args) {
        //统计
        File f1 = new File("E:\\uexs\\abc\\");
        String[] fs = f1.list((f, s) -> s.contains("c"));
        for (String t : fs) {
            System.out.println(t);
        }
    }

    public static void create(String[] arge) {
        // 建立目录
        String dir = "E:\\uexs\\abc\\cba";
        File f2 = new File(dir);
        if (!f2.exists()) {
            f2.mkdirs();
        }
        //建立100个记事本文件
        for (int i = 0; i < 100; i++) {
            String u = UUID.randomUUID().toString().toLowerCase();
            try (var out = new PrintWriter("E:\\uexs\\abc\\" + u + ".txt")) {
                out.println(u);
                out.println(u);
                out.println(u);
                out.flush();
                System.out.println();
            } catch (Exception e) {

            }
        }
    }
}
